﻿using System.Diagnostics;
using System.IO;

using Ycg.NLogging.Formatters;

/*
 * 问题一：需要整理下构架函数的关系
 */

namespace Ycg.NLogging.TranceListeners
{
    public class FileTraceListener : TraceListener
    {
        private TextWriter _textWriter = null;
        private string _filePath = string.Empty;
        private ILogFormatter _formatter = null;

        public FileTraceListener()
        {
        }

        public FileTraceListener(string filePath)
        {
            this._filePath = filePath;
        }

        public FileTraceListener(ILogFormatter formatter)
        {
            this._formatter = formatter;
        }

        public FileTraceListener(Stream stream)
        {
            this._textWriter = new StreamWriter(stream);
        }

        public FileTraceListener(Stream stream, ILogFormatter formatter)
        {
            this._formatter = formatter;
            this._textWriter = new StreamWriter(stream);
        }

        public FileTraceListener(TextWriter textWriter)
        {
            this._textWriter = textWriter;
        }

        public FileTraceListener(TextWriter textWriter, ILogFormatter formatter)
        {
            this._formatter = formatter;
            this._textWriter = textWriter;
        }

        public override void Write(string message)
        {
            throw new System.NotImplementedException();
        }

        public override void WriteLine(string message)
        {
            throw new System.NotImplementedException();
        }

        public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
        {
            //base.TraceData(eventCache, source, eventType, id, data);
        }
    }
}
